<?php
class OopsProgram{
	public $table;
	function makeConnect($localhost,$user,$pass,$mydb,$tab)
	{
		mysql_connect($localhost,$user,$pass);
			    mysql_select_db($mydb);
	    $this->table=$tab;	 
	}
	 
	 
	 
	function displayForm()
	 
	{
	 
	    return('
	 
	    <form method="post" action="registration.php" id="log_in">
	 
	    <table width="75%" border="0" align="center" bgcolor="#980000"  cellpadding="9" cellspacing="3">
  <tr width="500" height="100">
     <td colspan="4" rowspan="2" background="4.jpg">
    </td>
    </tr>
    <tr>
    <tr>
    <td width="39%" height="36" align="right" valign="top" size="30%">
    <font size="5" color="#ffffff">
    User Name:
    </font>
    </td>
          <td>
      <input name="user_name" type="text" id="user_name" value="" size="50" /></td>
    </tr>
    <tr>
     <td width="39%" height="36" align="right" valign="top" size="30%">
    <font size="5" color="#ffffFF">
     Password:
    </font>
    </td>
     <td><input name="password" type="password" id="password" size="50" /></td>
  </tr>
   <tr><td></td></tr>
    <tr><td></td></tr>
  
    <tr>
      <td><?php echo $errormsg ;?></td>
      <td><input type="submit" name="Log_in" onclick="" id="Log_in" value=" Log-In " style="background:#FCF" /></td></tr>
      <tr> <td>&nbsp;</td>
<tr>
      <td><?php echo $errormsg ;?></td>
      <td><input type="submit" name="create new account" id="create" value=" create new account " style="background:#FCF" /></td></tr>
      <tr> <td>&nbsp;</td>
      <td></td>
    </tr>
    <tr><td></td></tr>
     <tr><td></td></tr>
    <tr><td></td></tr>
     <tr><td></td></tr>
    
  
     <tr >
      <td align="center" colspan="2">
<font face="Snap ITC" size="3" color="#ffffff">
<B>
<h3 align="center"> CopyRight© 2014</h3>
      </B>
      </font>
      </td></tr>
  </table>

	 	</form>');    
	 
	}
	 
	 
	function checkUser($username,$password)
	 
	{
	    echo("check user");
	    $query="select * from ".$this->table. " where user='".$username."' and password='".$password."'";
	 
	    $result=mysql_query($query);	 
	    $num=mysql_num_rows($result);
	    return !($num==0);	 
	}
	 
	}
	 
	?>
